const landDom = document.querySelector(".land")

const landStyle = getComputedStyle(landDom)

const landWidth = parseFloat(landStyle.width)
const landHeight = parseFloat(landStyle.height)
const landtop = parseFloat(landStyle.top)

class Land extends Rectangle {
    constructor(xspeed) {
        super(landWidth, landHeight, 0, landtop, xspeed, 0, landDom)
    }

    onMove() {
        if (this.left < -landWidth / 2) {
            this.left = 0
        }
    }

}

let land = new Land(-150)   //传入land的速度

setInterval(function () {
    land.move(16 / 1000)
}, 16)